﻿using System;
using System.Drawing;
namespace RPG1
{
    public class Minotaur : Role, ISuperAttack
    {
        public Minotaur() : base()
        {
        }
        public Minotaur(int id, string name, int originalLife, int currentLife, int damage, int agile, int brains, int speed, Point currentLocation, Point originaLocation, Weapon wpn)
            : base(id, name, originalLife, currentLife, damage, agile, brains, speed, currentLocation, originaLocation, wpn)
        {
        }
        public override int getAttack() {
            return (int)((Damage * 4.5 + Brains * 2 + Wpn.Atk)*getSuperAttack());
        } //勇士攻击力 = 力量 * 4.5 + 智力 * 1.2 + 武器的攻击力
        public override int getDefense() {
            return (int)(Agile * 8 + Damage * 2.5 + Brains+Wpn.Defense);
        } //勇士防御力 = 敏捷 * 8 + 力量 * 2.5 + 智力 * 1 + 武器的防御力

        public double getSuperAttack()
        {
            Random rd = new Random();
            int probability = rd.Next(0, 101) + Wpn.Luck * 10;   // (生成0~101之间的随机数，不包括101)
            if (probability < 50)
                return 1;
            else
                return 1.5;
        }
    }
}
